package com.tek.ding.faceding.base;

import android.app.Activity;
import android.content.Context;

import androidx.fragment.app.Fragment;

public class BasePresenter<M, V extends BaseView> {

    protected M model;
    protected V view;

    protected Context context;

    public BasePresenter(M model, V view) {
        this.model = model;
        this.view = view;

        initContext();
    }

    private void initContext() {
        if (view instanceof Fragment) {
            context = ((Fragment) view).getActivity();
        } else {
            context = (Activity) view;
        }
    }
}
